﻿<UserControl x:Class="Asko.Lib.Views.GraphView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions" 
             xmlns:wc="clr-namespace:WPFExtensions.Controls;assembly=WPFExtensions"
             xmlns:views="clr-namespace:Asko.Lib.Views"
             xmlns:ac="clr-namespace:Asko.Lib.Controls"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid x:Name="graphCanvas">
                <ItemsControl ItemsSource="{Binding Edges}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Canvas>
                                <views:EdgeView Source="{Binding Source.View}" Target="{Binding Target.View}">
                                </views:EdgeView>
                            </Canvas>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <ItemsControl x:Name="icNodes" ItemsSource="{Binding Nodes}">
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <ac:GraphCanvas/>
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Canvas>
                                <views:NodeView Loaded="NodeView_Loaded">
                                    <i:Interaction.Behaviors>
                                        <ei:MouseDragElementBehavior DragFinished="MouseDragElementBehavior_DragFinished" />
                                    </i:Interaction.Behaviors>
                                </views:NodeView>
                            </Canvas>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>    
     
    </Grid>
</UserControl>
